package com.bill.gaty.mfidelity.beans.translation;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class TranslationResponse {
private ResponseData responseData;
private String responseDetails;
private int responseStatus;
private String responderId;
private List<Match>  matches;
public Match getMostMatch(){
	if(null==matches||matches.size()==0)
		return null;
	Collections.sort(matches,new Comparator<Match>() {

		@Override
		public int compare(Match m1, Match m2) {
			// TODO Auto-generated method stub
			float res=m1.getMatch()-m2.getMatch();
			 if(res<0) return -1;
			 if(res>0)return 1;
			 return 0;
		}
	});
return  matches.get(matches.size()-1);
}
@Override
public String toString() {
	return "TranslationResponse [responseData=" + responseData
			+ ", responseDetails=" + responseDetails + ", responseStatus="
			+ responseStatus + ", responderId=" + responderId + ", matches="
			+ matches + "]";
}
public ResponseData getResponseData() {
	return responseData;
}
public void setResponseData(ResponseData responseData) {
	this.responseData = responseData;
}
public TranslationResponse() {
	super();
	// TODO Auto-generated constructor stub
	matches=new ArrayList<Match>();
	responseData=new ResponseData();
	
}
public String getResponseDetails() {
	return responseDetails;
}
public void setResponseDetails(String responseDetails) {
	this.responseDetails = responseDetails;
}
public int getResponseStatus() {
	return responseStatus;
}
public void setResponseStatus(int responseStatus) {
	this.responseStatus = responseStatus;
}
public String getResponderId() {
	return responderId;
}
public void setResponderId(String responderId) {
	this.responderId = responderId;
}
public List<Match> getMatches() {
	return matches;
}
public void setMatches(List<Match> matches) {
	this.matches = matches;
}
}
